package top.toptimus.dto.measure;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.dto.customerInfo.CustomerMeasureInfo;

/**
 * 成衣量体值配置
 */
@NoArgsConstructor
@Data
@AllArgsConstructor
public class MeasureBaseDTO {
    private String itemCd;
    private String itemValue;
    private String itemNameCn;

    /**
     * 非空值
     *
     * @param customerMeasureInfo 客户量体值信息
     * @return 客户量体值信息
     */
    public CustomerMeasureInfo build(CustomerMeasureInfo customerMeasureInfo) {
        return new CustomerMeasureInfo(
                this.itemCd
                , this.itemValue
                , this.itemNameCn
                , customerMeasureInfo.getCustomerFitValue()
        );
    }

    /**
     * 空值
     *
     * @return 客户量体值信息
     */
    public CustomerMeasureInfo build() {
        return new CustomerMeasureInfo(
                this.itemCd
                , this.itemValue
                , this.itemNameCn
                , ""
        );
    }
}
